package com.app.bimo.module_bookrack.mvp.constract;



import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.commonbusiness.mvp.IModel;
import com.app.bimo.commonbusiness.mvp.IView;
import com.app.bimo.library_db.SearchData;
import com.app.bimo.library_db.SearchHistory;

import java.util.List;

import io.reactivex.Observable;


public interface BookrackSearchContract {
    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
    interface View extends IView {
        void hotSearchNotify(List<SearchData> lists);

        void historyNotify(List<SearchHistory> lists);

        void searchNotify(List<SearchData> lists);
        void showSearchEmtyView();
    }

    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,如是否使用缓存
    interface Model extends IModel {
        Observable<BaseResult<List<SearchData>>> getHotSearch();

        Observable<BaseResult<List<SearchData>>> getSearch(String keyword, int page);

        Observable<BaseResult<List<SearchHistory>>> getSearchHistory();
    }
}